package com.zhx.real.core.util;

import lombok.Builder;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author ：zhanghaixuan
 * @date ：Created in 2019-03-21 10:31
 * @description：用途: 返回值的公共模型
 * @modified By：zhanghaixuan
 * @version: 1.0
 */
@Builder
@ToString
@Data
public class Result<T> implements Serializable {

    private Integer code;

    private String msg;

    private T data;

    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

	public Result() {
	}

	public Result(Integer code, String msg, T data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public boolean isNull(){
    	return null == data;
	}
}
